package com.ptone.messagecenter.modules.msg.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ptone.messagecenter.common.base.PageForm;
import com.ptone.messagecenter.modules.msg.entity.MsgTemplate;
import com.ptone.messagecenter.modules.msg.mapper.MsgTemplateMapper;
import com.ptone.messagecenter.modules.msg.service.MsgTemplateService;
import org.springframework.stereotype.Service;

/**
 * 消息模板：serviceImpl
 *
 * @author:Lance
 */
@Service
public class MsgTemplateServiceImpl extends ServiceImpl<MsgTemplateMapper, MsgTemplate> implements MsgTemplateService {
    /**
     * 消息模板-insertOrUpdate
     *
     * @param info
     * @return
     */
    @Override
    public Boolean insertOrUpdate(MsgTemplate info) {
        return super.saveOrUpdate(info);
    }

    /**
     * 消息模板-delete
     *
     * @param info
     * @return
     */
    @Override
    public Boolean delete(MsgTemplate info) {
        return info.deleteById();
    }

    /**
     * 消息模板-info
     *
     * @param info
     * @return
     */
    @Override
    public MsgTemplate info(MsgTemplate info) {
        return info.selectById();
    }

    /**
     * 消息模板-page
     *
     * @param form
     * @return
     */
    @Override
    public IPage<MsgTemplate> page(PageForm<MsgTemplate> form) {
        IPage<MsgTemplate> page = form.newPage();
        return super.lambdaQuery().page(page);
    }
}
